package paas.storage.result;

import paas.storage.common.constant.ResponseCode;

/**
 * 返回类
 *
 * @author xufeng
 * @version 1.0
 * @date 2021/1/23
 */

public  class Response{

    /**
     * 任务状态 0=失败,1=成功
     */
    private int taskStatus;
    /**
     * 错误码
     */
    private int errorCode;

    /**
     * 错误消息
     */
    private String errorMsg;



    public Response(int taskStatus, int errorCode, String errorMsg){
        Response response = new Response();
        response.setTaskStatus(taskStatus);
        response.setErrorCode(errorCode);
        response.setErrorMsg(errorMsg);
    }

    public Response() {
        this.setTaskStatus(ResponseCode.TASK_STATUS_OK);
    }


    public int getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(int taskStatus) {
        this.taskStatus = taskStatus;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public String toString() {
        return "Response{" +
                "taskStatus=" + taskStatus +
                ", errorCode=" + errorCode +
                ", errorMsg='" + errorMsg + '\'' +
                '}';
    }
}
